package org.hongzhisoft.dis.service.impl;

import java.util.List;

import org.hongzhisoft.dis.bean.User;
import org.hongzhisoft.dis.dao.UserDao;
import org.hongzhisoft.dis.service.UserService;

/**
 * 用户业务处理实现类
 * 
 * @author HongChengzhi
 *
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDao();

    @Override
    public List<User> selectByAll() throws Exception {
        return userDao.selectAll();
    }

    @Override
    public User selectById(int id) throws Exception {
        return userDao.selectById(id);
    }

    @Override
    public int saveUser(User user) throws Exception {
        return userDao.insertUser(user);
    }

    @Override
    public int updateUser(User user) throws Exception {
        return userDao.updateUser(user);
    }

    @Override
    public int deleteUser(int id) throws Exception {
        return userDao.deleteUser(id);
    }
    
    @Override
    public User loginUser(String account, String password) throws Exception {
        return userDao.loginUser(account, password);
    }

}
